﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public static class LogData
    {
        public static void SaveLog(string userName, string logType, string entryPoint, string summary, string details)
        {
            using (DBDataContext dataContext = new DBDataContext(Utils.ConnectionString))
            {
                Log l = new Log();
                l.UserName = userName;
                l.LogDate = DateTime.Now;
                l.LogType = logType;
                l.EntryPoint = entryPoint;
                l.Summary = summary;
                l.Details = details;
                dataContext.Logs.InsertOnSubmit(l);
                dataContext.SubmitChanges();
            }
        }
    }
}
